<?php
$auth_user = $this->Session->read('loginData');
$user_level = $auth_user['user_level'];
if ($user_level != 'Normal') {
    ?>
    <div id="left_nav" class="span4">
        <div id="nav_group" class="inner_shadow">
            <?php
            if ($user_level == 'Admin') {
                echo $this->element('bank/nav_admin');
            } elseif ($user_level == 'Supervisor') {
                echo $this->element('bank/nav_branch_sup');
            }
            ?>
        </div>
    </div>
<?php
}
else{
    ?>
    <div id="left_nav" class="span3" style="padding: 0px;">
        <div id="nav_group" class="inner_shadow">
            <ul>
                <li>
                    <a href="<?php echo $this->Html->url(array('action' => 'index')); ?>"><i class="icon-home icon-2x"></i></a>
                        <span>
                            <a href="<?php echo $this->Html->url(array('action' => 'index')); ?>"> Search</a>
                            <p>Search Student</p>
                        </span>
                </li>
            </ul>
        </div>
    </div>
<?php
}
?>
<div class="span8"  style="padding:10px; background-color: #fff; min-height: 480px;">
    <?php
    $error = false;
    if($this->Session->check('process_error')){
        if($this->Session->read('process_error') == 'yes'){
            $error = true;
        }
        $controller->Session->delete('process_error');
    }
    ?>
    <?php
    $flash_msg = $this->Session->read('Message');
    if(isset($flash_msg['flash'])){
        ?>
        <div id="loginmsg" style="">
            <?php
            if($error){
                echo $this->Message->msg('Profile Update',$this->Session->flash(),'error',true);
            }
            else{
                echo $this->Message->msg('Profile Update',$this->Session->flash(),'success',true);
            }
            ?>
        </div>
    <?php
    }
    ?>
    <?php echo $this->Form->create('AuthenticatedApp', array('id' => 'form', 'class' => 'form form-horizontal', 'inputDefaults' => array('label' => false,'div' => false)));?>
    <fieldset>
        <legend><?php echo $bank_info['Bank']['bank_full'].' API Settings';?> ! </legend>
        <div class="control-group">
            <label class="control-label" for="username">* APP ID:</label>
            <div class="controls">
                <?php $authuser['username'] ;?>
                <?php echo $this->Form->input('app_id', array('type'=>'text','id'=>'app_id', 'class' => 'input-block-level', 'value'=>$data_api['app_id'], 'required'=>'required','div' => false, 'label' => false,)); ?>
            </div>
        </div>

        <div class="control-group cheque_row">
            <label class="control-label" for="password">APP KEY:</label>
            <div class="controls">
                <?php echo $this->Form->input('app_key_pass', array('id'=>'app_key_pass', 'class' => 'input-block-level', 'value'=>$data_api['app_key'],'div' => false, 'label' => false,)); ?>
            </div>
        </div>
        <div class="control-group cheque_row">
            <label class="control-label" for="password">SALT:</label>
            <div class="controls">
                <?php echo $this->Form->input('app_key_salt', array('id'=>'app_key_salt', 'class' => 'input-block-level', 'value'=>$data_api['app_key_salt'],'div' => false, 'label' => false,)); ?>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">&nbsp;</label>
            <div class="controls">
                <button type="submit" id="update_btn" class="btn btn-primary">Update Info</button>
                <button type="reset"  id="reset_btn" class="btn">Cancel</button>
            </div>
        </div>

        <?php echo $this->Form->input('id', array('type'=>'hidden','id'=>'id', 'value'=>$data_api['id'],'div' => false, 'label' => false,)); ?>
        <?php echo $this->Form->input('modified_by', array('type'=>'hidden','id'=>'modified_by', 'value'=>$authuser['id'],'div' => false, 'label' => false,)); ?>
    </fieldset>
    <?php echo $this->Form->end();?>
</div>